<?php
class Helper {
	public $configXml;
	public function __construct(){
		$this->configXml = $this->loadXmlFile();
	}
	public function loadXmlFile($path=""){
		if ($path){
			$xml = simplexml_load_file("$path");
		}else{
			$xml = simplexml_load_file("config/xml/system.xml");
		}
		return $xml;
	}
	public function formDataFilter($str){
		$str = htmlspecialchars($str);
		$str = str_replace(chr(13),"<br />",$str);
		$str = str_replace(chr(32),"&nbsp;",$str);
		return $str;
	}
	public function getPicturceFolderDefaultCover(){
		$cover = $this->configXml->xpath("pictures/folderCoverNone");
		$cover = $cover[0];
		return (string)$cover;
	}
	public function getPicturceBaseFolder(){
		$folder = $this->configXml->xpath("pictures/baseFolder");
		$folder = $folder[0];
		return (string)$folder;
	}
	
	public function getEventBaseFolder(){
		$folder = $this->configXml->xpath("events/baseFolder");
		$folder = $folder[0];
		return (string)$folder;
	}
}

?>